package com.iwhale.sequence.redisidx.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "sequence-server.sequence")
public class SequenceConfig {

    // 步长
    private int delta;

    // 从redis自动获取下一seq段的阈值
    private int paddingFactor;

    // 起始序列ID
    private long startSequence;

    public int getDelta() {
        return delta;
    }

    public void setDelta(int delta) {
        this.delta = delta;
    }

    public int getPaddingFactor() {
        return paddingFactor;
    }

    public void setPaddingFactor(int paddingFactor) {
        this.paddingFactor = paddingFactor;
    }

    public long getStartSequence() {
        return startSequence;
    }

    public void setStartSequence(long startSequence) {
        this.startSequence = startSequence;
    }

    public int getPaddingThreshold() {
        return delta * paddingFactor / 100;
    }
}
